using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreData;
using Services;
using Helper;
namespace ActionServices
{

    public interface IStudentActionService:BaseActionService
    {
        long Save(object _model, ref string mess);
        long SaveDuplicate(object _model, ref string mess);
        IList<CoreData.Student> GetListByLINQ(Func<CoreData.Student, Boolean> _where);
        CoreData.Student GetOneByLINQ(Func<CoreData.Student, Boolean> _where);
        bool Delete(object _model);
        IList<CoreData.Student> GetByClassID(long ClassID);
        bool UpdateIsDelete(object _model);
         IList<CoreData.Student> GetByStatusID(long Status);
         IList<CoreData.Student> GetByChannelID(long Channel);
         IList<CoreData.Student> GetByCourseID(long CourseID);
         IList<CoreData.Student> GetByBranchID(long BranchID, DateTime datefrom, DateTime dateto);
         IList<CoreData.Student> GetByMultiCondition(long BranchID, long CourseID, long ClassID, long StatusID,
           long ChannelID, DateTime datefrom, DateTime dateto, int Birthfrom, int Birthto);
         int ExcuteChangeTypeOfFee(long StudentID, int newtype);
         string GenerateCode(long ClassID);
         CoreData.Student GetOneByCode(string Code);
         bool SaveStudentFeeTime(long StudentID, int type, int Price,long classId, DateTime StartDate, DateTime EndDate,
             DateTime StartDate1, DateTime EndDate1, DateTime StartDate2, DateTime EndDate2, DateTime StartDate3, DateTime EndDate3,
             DateTime StartDate4, DateTime EndDate4, DateTime StartDate5, DateTime EndDate5, DateTime StartDate6, DateTime EndDate6,
             int Money1 = 0, int Money2 = 0, int Money3 = 0, int Money4 = 0, int Money5 = 0, int Money6 = 0);
         CoreData.Student GetByTempStudentID(long tempStudentId);
         IList<Student> GetListStudentReserved();
    }

    public partial class StudentActionService:IStudentActionService
    {
       StudentService Service;

       public StudentActionService()
       {
           Service = new StudentService();
       }

       #region Main Method

       public virtual long Save(object _model, ref string mess)
       {
           return Service.Save(_model, ref mess);
       }
        public virtual long SaveDuplicate(object _model, ref string mess)
        {
            return Service.SaveDuplicate(_model, ref mess);
        }

       public virtual object GetByID(long _id)
       {
           return Service.GetByID(_id);
       }

       public virtual object GetList()
       {
           return Service.GetList();
       }

       public virtual IList<CoreData.Student> GetListByLINQ(Func<CoreData.Student, Boolean> _where)
       {
           return Service.GetListByLINQ(_where);
       }

       public virtual CoreData.Student GetOneByLINQ(Func<CoreData.Student, Boolean> _where)
       {
           return Service.GetOneByLINQ(_where);
       }

       public virtual object GetList(string _searchstring)
       {
           return Service.GetList(_searchstring);
       }

       public virtual bool Delete(object _model)
       {
           return Service.Delete(_model);
       }

       public virtual bool UpdateIsDelete(object _model)
       {
           return Service.UpdateIsDelete(_model);
       }

       #endregion


        #region Other Method

       public virtual IList<CoreData.Student> GetByClassID(long ClassID)
       {
           return Service.GetByClassID(ClassID);
       }

          public virtual IList<CoreData.Student> GetByStatusID(long Status)
       {
           return Service.GetByStatusID(Status);
       }
       public virtual IList<CoreData.Student> GetByChannelID(long Channel)
       {
              return Service.GetByChannelID(Channel);
       }

       public virtual IList<CoreData.Student> GetByCourseID(long CourseID)
       {
           return Service.GetByCourseID(CourseID);
      }
      public virtual IList<CoreData.Student> GetByBranchID(long BranchID, DateTime datefrom, DateTime dateto)
        {
           return Service.GetByBranchID(BranchID, datefrom,dateto);
       }

      public virtual IList<CoreData.Student> GetByMultiCondition(long BranchID, long CourseID, long ClassID, long StatusID,
         long ChannelID, DateTime datefrom, DateTime dateto, int Birthfrom, int Birthto)
      {
          return Service.GetByMultiCondition(BranchID, CourseID, ClassID, StatusID, ChannelID, datefrom, dateto, Birthfrom, Birthto);
      }


      public virtual int ExcuteChangeTypeOfFee(long StudentID, int newtype)
      {
          return Service.ExcuteChangeTypeOfFee(StudentID, newtype);
      }
      public virtual string GenerateCode(long ClassID)
        {
            return Service.GenerateCode(ClassID);
        }

      public virtual CoreData.Student GetOneByCode(string Code)
      {
          return Service.GetOneByCode(Code);
      }


      public virtual  bool SaveStudentFeeTime(long StudentID, int type, int Price,long classId, DateTime StartDate, DateTime EndDate,
            DateTime StartDate1, DateTime EndDate1, DateTime StartDate2, DateTime EndDate2, DateTime StartDate3, DateTime EndDate3,
            DateTime StartDate4, DateTime EndDate4, DateTime StartDate5, DateTime EndDate5, DateTime StartDate6, DateTime EndDate6,
            int Money1=0, int Money2=0, int Money3=0, int Money4=0, int Money5=0, int Money6=0)
      {

          return Service.SaveStudentFeeTime(StudentID, type, Price,classId, StartDate, EndDate, StartDate1, EndDate1, StartDate2, EndDate2,
              StartDate3, EndDate3, StartDate4, EndDate4, StartDate5, EndDate5, StartDate6, EndDate6, Money1, Money2, Money3, Money4,
              Money5, Money6);

        }

      public virtual CoreData.Student GetByTempStudentID(long tempStudentId)
      {
          return Service.GetByTempStudentID(tempStudentId);
      }
      public IList<Student> GetListStudentReserved()
      {
          return Service.GetListStudentReserved();
      }
        #endregion

    }
         
}
